<template>
  <div>
    <canvas ref="canvasRef" width='1024' height='720' style='border: 1px solid'></canvas>
  </div>
</template>

<script setup>
import {onMounted, ref} from "vue";
import {LGraph, LGraphCanvas, LiteGraph} from "litegraph.js";

const canvasRef = ref(null)
onMounted(() => {
  let graph = new LGraph();
  let canvas = new LGraphCanvas(canvasRef.value, graph);
  let node_const = LiteGraph.createNode("basic/const");
  node_const.pos = [200, 200];
  graph.add(node_const);
  node_const.setValue(4.5);
  let node_watch = LiteGraph.createNode("basic/watch");
  node_watch.pos = [700, 200];
  graph.add(node_watch);
  node_const.connect(0, node_watch, 0);
  graph.start()
})
</script>